<%@page import="com.google.gson.JsonArray"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.List"%>
<%@page import="conn.img"%>
<%@page import="com.google.gson.Gson"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<html>
<head>
<link rel="stylesheet" href="css/pintuer.css">
<script src="js/jquery.js"></script>
<script src="js/pintuer.js"></script>
<link type="image/x-icon" href="JavaScript:;/favicon.ico" rel="shortcut icon" />
<link href="JavaScript:;/favicon.ico" rel="bookmark icon" />
<title>Insert title here</title>
<style type="text/css">
.window0{
			width: 100%;
		}
		.window1{
			width: 936px;
			margin: auto;
		}
		.first{width:200px;height:300px;border:1px solid #02AAF1 ;margin: 20px 15px;float: left;}
		.first img{width: 160px;height: 260px;margin:20px}
		.imgName{text-align: center;}
		.demo-nav.fixed.fixed-top {
				z-index: 8;
				background: #fff;
				width: 100%;
				padding: 0;
				border-bottom: solid 3px #0a8;
				-webkit-box-shadow: 0 3px 6px rgba(0, 0, 0, .175);
				box-shadow: 0 3px 6px rgba(0, 0, 0, .175);
			}
			.secoud{float: left;margin: 20px 15px;}
</style>
</head>
<body>
	<jsp:useBean id="Connection1" class="conn.Connection1"></jsp:useBean>
	<jsp:setProperty property="*" name="Connection1"/>
	<jsp:useBean id="FindCode" class="conn.Connection1"></jsp:useBean>
	<jsp:include page="header.jsp" flush="true"> <jsp:param name="name" value="value"/> </jsp:include>
	<%-- <div id="flag1" style="display:none"><%=request.getAttribute("flag") %></div>  --%>
	<%-- <div> ".............." ${json}</div>  --%>
	<div id="flag" style="display:none">${flag}</div> 
		<c:forEach items="${list}" var = "img">
			<div class="window0">
				<div class="window1">
					<div class="first">
						<a href='showDetailsImg?id=${img.id}'>
							<input type=hidden value="${img.id}" />
							<img src="${img.imgSrc}" onerror="javascript:this.src='http://rqfhis.wolfword.com:10006/testWeb/images/123123123.jpg'" />
							<div class="imgName">名字：${img.imgOtherName}</div>
						</a>
					</div>
					<c:if test="${username!=null}" >
						<div class="secoud">
							<p><a style="color:#f00" href="deleteServlet?id=${img.id}">删除</a></p>
							<p>
								<form action="UpdateServlet" method="get" onsubmit="return check(this);">
									<input type="hidden" name="id" value="${img.id}">
									名字:<input style="width:auto;" type="text" value="${img.imgOtherName}" name="imgOtherName">
									<input type="submit" value="修　改">
								</form>
							</p>
						</div>
					</c:if>
				</div>
			</div>
		</c:forEach>
		<jsp:include page="footer.jsp" flush="true"> <jsp:param name="name" value="value"/> </jsp:include>
</body>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
	function check(form){
		with(form){
			if(imgOtherName.value==""){
				alert("请输入一个值！");
				return false;
			}
			return true;;
		}
	}
</script>
</html>